# -*- coding: utf-8 -*-

from gi.repository import Gtk

from vtn_base import VtnBase

class VtnSo(VtnBase):

    def __init__(self, parent_window):
        VtnBase.__init__(self, "vtn_so", parent_window)
        self.show_background_image("bk_toquin")
        self.show()
   
    #-- Creamos el ListStore
        almacenamiento = Gtk.ListStore('gboolean',str,str,str)
        self.treeview_os.set_model(almacenamiento)   
        self.treeview_os.set_reorderable(True)
        self.crear_columnas(self.treeview_os)
        
    #-- Funcion que define las columnas del Treeview de los OS     
    def crear_columnas(self,treeview_os):
        rendererToggle = Gtk.CellRendererToggle()
        rendererToggle.set_property('radio',True)
        columna = Gtk.TreeViewColumn("Marcar", rendererToggle)        
        columna.add_attribute(rendererToggle, "active", 1)            
        columna.set_sort_column_id(0)
        self.treeview_os.append_column(columna)
        
        rendererText = Gtk.CellRendererText()
        columna = Gtk.TreeViewColumn("Sistema Operativo", rendererText, text = 2)
        columna.set_sort_column_id(1)
        self.treeview_os.append_column(columna)
        
        columna = Gtk.TreeViewColumn("Versión", rendererText, text = 3)
        columna.set_sort_column_id(2)
        self.treeview_os.append_column(columna)
        
        columna = Gtk.TreeViewColumn("Tamaño", rendererText, text = 4)
        columna.set_sort_column_id(3)
        self.treeview_os.append_column(columna)              

    def on_btn_ayuda_clicked(self, widget, *args):
        print "on_btn_ayuda_clicked called with self.%s" % widget.get_name()

    def on_btn_grabarcd_clicked(self, widget, *args):
        print "on_btn_grabarcd_clicked called with self.%s" % widget.get_name()

    def on_btn_grabarusb_clicked(self, widget, *args):
        print "on_btn_grabarusb_clicked called with self.%s" % widget.get_name()
